 <?php 
					include "/include/common.php";
					include APP_PATH . "include/ItemModel.php";
					//当前页
					$page = !empty($_GET['page']) ? intval($_GET['page']):1;
					//$total = 31;
					$perpage = 4;
					
					
					$ItemModle = new ItemModel();
					//传值当前页，每页数量，获取分页数据
					//总数，列表结果集
					$data=$ItemModle -> getPageList($page,$perpage);
					$total = $data[0];
					$lists = $data[1];
					
					
					//$lists = $ItemModle->getAllList();
					//分类
					include APP_PATH . "include/ListModel.php";
					$ListModel = new ListModel();
					$cats = $ListModel->getAllList();
					$scats =[];
					foreach($cats as $key =>$val){
					    $scats[$val['id']] = $val;
					}
					
					//var_dump($cats);
					//var_dump($scats);
					
					
					include APP_PATH ."include/Page.php";
					$PageObj = new Page($total, $perpage, $page);
					//$pages就是一个HTML的字符串，
					$pages = $PageObj->show();
					?>